repo: Optimize bare-user content object reads a bit
authorColin Walters <walters@verbum.org>
Fri, 14 Apr 2017 19:15:23 +0000 (15:15 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 19 Apr 2017 15:00:08 +0000 (15:00 +0000)
commit49a525f6a5b4f99a85bbe653684afd111fa92070
tree781e22d921417aaea7797cc56ebbe1b1ee1b125c
parent0d8cd2f0770501fb454a00a5d47ad2d53977f65a
repo: Optimize bare-user content object reads a bit

`perf record ostree checkout ...` for a bare-user repo was telling
me we were spending a good 13% of our time in the depchain of `ot_lgexattrat()`.
The problem here is that traversing the `/proc` path turns out to be
somewhat expensive - there are LSM (SELinux) checks, etc.

For regular files, opening and just getting the xattr, then closing is still
quite cheap. For symlinks, we'll always need to open anyways.

This appears to shave about ~0.1 seconds off of a checkout of
`fedora-atomic/25/x86_64/docker-host` on my workstation.

Oh, and this was the last user of `ot_lgexattrat()` so we can kill it, which is
nice - the xattr code should really live in libglnx.

Closes: #796
Approved by: jlebon
src/libostree/ostree-repo.c
src/libotutil/ot-fs-utils.c
src/libotutil/ot-fs-utils.h